package com.zekdot.registerclient.service.mq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Create by zekdot on 20-4-12.
 */
@Configuration
public class UpdateRabbitConfig {
    @Bean
    public Queue UpdateQueue(){
        return new Queue("UpdateQueue",true);
    }

    @Bean
    DirectExchange UpdateExchange(){
        return new DirectExchange("UpdateExchange");
    }

    @Bean
    Binding bindingDirect(){
        return BindingBuilder.bind(UpdateQueue()).to(UpdateExchange()).with("UpdateRouting");
    }
}